package com.amgl.mobike.module.search;

import com.amgl.mobike.network.response.SearchResult;

/**
 * Created by 阿木 on 2017/5/27.
 */

public class ImageData {
    private String title;
    private String imageUrl;
    private String imageThumb;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getImageThumb() {
        return imageThumb;
    }

    public void setImageThumb(String imageThumb) {
        this.imageThumb = imageThumb;
    }

    public static ImageData parse(SearchResult searchResult) {
        if (searchResult == null)
            return null;

        ImageData imageData = new ImageData();
        imageData.setTitle(searchResult.getTitle());
        imageData.setImageUrl(searchResult.getImg());
        imageData.setImageThumb(searchResult.getThumb());
        return imageData;
    }
}
